package com.serviceprovider.business.module.admin.bonus.model;

public class BonusCalculationResultDetail {
    private Double  bonusEarned      = 0.0;
    private Integer customerCount    = 0;
    private Integer transactionCount = 0;
    private Integer affiliateId;
    private Integer serviceProviderId;
    private String  serviceProviderName;

    @Override
    public boolean equals(Object obj) {
        if ((obj == null) ||!(obj instanceof BonusCalculationResultDetail)) {
            return false;
        }

        BonusCalculationResultDetail b  = (BonusCalculationResultDetail) obj;
        boolean                      eq = ((serviceProviderId == null) && (b.serviceProviderId == null))
                     || ((serviceProviderId != null) && serviceProviderId.equals(b.serviceProviderId));

        if (!eq) {
            return false;
        }

        eq = ((serviceProviderName == null) && (b.serviceProviderName == null))
             || ((serviceProviderName != null) && serviceProviderName.equals(b.serviceProviderName));

        if (!eq) {
            return false;
        }

        eq = ((customerCount == null) && (b.customerCount == null))
             || ((customerCount != null) && customerCount.equals(b.customerCount));

        if (!eq) {
            return false;
        }

        eq = ((transactionCount == null) && (b.transactionCount == null))
             || ((transactionCount != null) && transactionCount.equals(b.transactionCount));

        if (!eq) {
            return false;
        }

        eq = ((affiliateId == null) && (b.affiliateId == null))
             || ((affiliateId != null) && affiliateId.equals(b.affiliateId));

        if (!eq) {
            return false;
        }

        eq = ((bonusEarned == null) && (b.bonusEarned == null))
             || ((bonusEarned != null) && bonusEarned.equals(b.bonusEarned));

        if (!eq) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int prime  = 31;
        int result = 1;

        result = prime * result + ((serviceProviderId == null)
                                   ? 0
                                   : serviceProviderId.hashCode());
        result = prime * result + ((serviceProviderName == null)
                                   ? 0
                                   : serviceProviderName.hashCode());
        result = prime * result + ((customerCount == null)
                                   ? 0
                                   : customerCount.hashCode());
        result = prime * result + ((transactionCount == null)
                                   ? 0
                                   : transactionCount.hashCode());
        result = prime * result + ((affiliateId == null)
                                   ? 0
                                   : affiliateId.hashCode());
        result = prime * result + ((bonusEarned == null)
                                   ? 0
                                   : bonusEarned.hashCode());

        return result;
    }

    public Integer getServiceProviderId() {
        return serviceProviderId;
    }

    public void setServiceProviderId(Integer serviceProviderId) {
        this.serviceProviderId = serviceProviderId;
    }

    public String getServiceProviderName() {
        return serviceProviderName;
    }

    public void setServiceProviderName(String serviceProviderName) {
        this.serviceProviderName = serviceProviderName;
    }

    public Integer getCustomerCount() {
        return customerCount;
    }

    public void setCustomerCount(Integer customerCount) {
        this.customerCount = customerCount;
    }

    public Integer getTransactionCount() {
        return transactionCount;
    }

    public void setTransactionCount(Integer transactionCount) {
        this.transactionCount = transactionCount;
    }

    public Integer getAffiliateId() {
        return affiliateId;
    }

    public void setAffiliateId(Integer affiliateId) {
        this.affiliateId = affiliateId;
    }

    public Double getBonusEarned() {
        return bonusEarned;
    }

    public void setBonusEarned(Double bonusEarned) {
        this.bonusEarned = bonusEarned;
    }
}



